﻿#region

using System.Security.Claims;
using Vin.Extension.JwtBearer.Attributes;
using Vin.Extension.JwtBearer.Constants;

#endregion

namespace Vin.Extension.JwtBearer.Models;

public record VinJwtTokenModel
{
    /// <summary>
    /// 会话id
    /// </summary>
    [VinJwtClaimType(VinClaimTypesConstant.UserId, JoinInJwt = true)]
    public string? UserId { get; set; }

    /// <summary>
    /// 会话前缀
    /// </summary>
    [VinJwtClaimType(VinClaimTypesConstant.Prefix, JoinInJwt = true)]
    public string? Prefix { get; set; }

    /// <summary>
    /// 真实账号Id
    /// </summary>
    [VinJwtClaimType(VinClaimTypesConstant.RealAccountId)]
    public long? RealAccountId { get; set; }

    /// <summary>
    /// 真实账号名称
    /// </summary>
    [VinJwtClaimType(VinClaimTypesConstant.AccountName)]
    public string? AccountName { get; set; }

    /// <summary>
    /// 真实用户id
    /// </summary>
    [VinJwtClaimType(VinClaimTypesConstant.RealUserId)]
    public long? RealUserId { get; set; }

    /// <summary>
    /// 真实用户名
    /// </summary>
    [VinJwtClaimType(ClaimTypes.Name)]
    public string? UserName { get; set; }

    /// <summary>
    /// 真实手机号
    /// </summary>
    [VinJwtClaimType(VinClaimTypesConstant.Phone)]
    public string? Phone { get; set; }

    /// <summary>
    /// 终端类型
    /// </summary>
    [VinJwtClaimType(VinClaimTypesConstant.TerminalType)]
    public string? TerminalType { get; set; }

    /// <summary>
    /// 平台
    /// </summary>
    [VinJwtClaimType(VinClaimTypesConstant.Platform)]
    public string? Platform { get; set; }

    /// <summary>
    /// 登录IP
    /// </summary>
    [VinJwtClaimType(VinClaimTypesConstant.Ip)]
    public string? Ip { get; set; }

    /// <summary>
    /// 登录地址
    /// </summary>
    [VinJwtClaimType(VinClaimTypesConstant.Location)]
    public string? Location { get; set; }

    /// <summary>
    /// 登录浏览器
    /// </summary>
    [VinJwtClaimType(VinClaimTypesConstant.Browser)]
    public string? Browser { get; set; }

    /// <summary>
    /// 登录操作系统
    /// </summary>
    [VinJwtClaimType(VinClaimTypesConstant.Os)]
    public string? Os { get; set; }

    /// <summary>
    /// 设备
    /// </summary>
    [VinJwtClaimType(VinClaimTypesConstant.Device)]
    public string? Device { get; set; }

    /// <summary>
    /// 用户代理
    /// </summary>
    [VinJwtClaimType(VinClaimTypesConstant.UserAgent)]
    public string? UserAgent { get; set; }

    /// <summary>
    /// 登录时间
    /// </summary>
    [VinJwtClaimType(VinClaimTypesConstant.LoginTime)]
    public DateTime? LoginTime { get; set; }

    public Dictionary<string, string>? Claims { get; set; }
}